package simtester.test.pages

import geb.Module
import geb.Page

class TestRunPage extends Page {
    static url = 'testRun/create'
    static at = { $('title').text() == 'SimTester - Run a Test' }
    
    static content = {
        addTestForm(required: false) { $('#addtestform') }
        
        testCasesTable {
            $('table tbody tr').collect {
                module TestCasesRow, it
            }
        }
    }
}

class TestCasesRow extends Module {
    static content = {
        cell { i -> $('td', i) }

        testname { cell(2).text() }
        type     { cell(3).text() }
        owner    { cell(4).text() }
        date     { cell(5).text() }
    }
}